package com.privated.work.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.privated.work.dao.UserMapper;
import com.privated.work.entity.User;
import com.privated.work.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {


    @Override
    public List<User> getAll() {
        return baseMapper.selectList(null);
    }

    @Override
    public Page<User> page(Integer page, Integer limit) {
        Page<User> pageData = new Page<>(page, limit);
        QueryWrapper queryWrapper = new QueryWrapper();
        Page<User> userPage = baseMapper.selectPage(pageData, null);
        return userPage;
    }
}
